package org.anupta.game.server.game.packet.account.character.selected.answer;

import org.anupta.game.main.Main;
import org.anupta.game.server.game.client.GameClient;
import org.anupta.game.server.game.packet.GamePacket;

public class CharacterSelectedStat extends GamePacket {
	public CharacterSelectedStat(GameClient client) {
		super(client);
		pack();
		doPacket();
	}

	@Override
	public void unpack() {
	}

	@Override
	public void pack() {
		packetOut.append("ASK|").append(client.getPlayer().getGuid()).append("|").append(client.getPlayer().getName()).append("|")
		.append(client.getPlayer().getLevel()).append("|").append(client.getPlayer().getClasse().getId()).append("|")
		.append(client.getPlayer().getSexe().getSexe()).append("|").append(client.getPlayer().getGfx()).append("|")
		.append((client.getPlayer().getColors()[0] == -1 ? "-1" : Integer.toHexString(client.getPlayer().getColors()[0])))
		.append("|").append((client.getPlayer().getColors()[1] == -1 ? "-1" : Integer.toHexString(client.getPlayer().getColors()[1])))
		.append("|").append((client.getPlayer().getColors()[2] == -1 ? "-1" : Integer.toHexString(client.getPlayer().getColors()[2])))
		.append("|").append(client.getPlayer().getStuffToASK());
	}

	@Override
	public void doPacket() {
		client.send(packetOut.toString());
		Main.out.println(new StringBuilder("CharacterSelectedStat packet sended to : ").append(client.getIp()).toString());
	}
}
